<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    //声明一数组
    const xiyou=["唐山","孙悟空","资本家","杀生"]

    //使用ofr of遍历
    // for(let v of xiyou){
    //     console.log(v)
    // }
    let iterator=xiyou[Symbol.iterator]();

    //调用对象next方法
    console.log(iterator.next())
    console.log(iterator.next())
    console.log(iterator.next())
    console.log(iterator.next())
    console.log(iterator.next())
</script>
</html>